package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @author 黑马程序员
 */
public interface UserMapper {

    //根据手机号查询用户对象
    @Select("select * from user where phone=#{phone}")
    User findByPhone(String phone);

    //新增用户
    @Insert("insert into user(phone,status) values(#{phone},#{status})")
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    Integer save(User user);
}
